<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Page extends MX_Controller {


	function __construct()
	{
		parent::__construct();
		$this->load->model('static/static_model');
		
		
		
	}
	
	function index(){
		
		$this->template->set_layout('static');
		
		$id = $this->commoncall->get_id(current_url());
		$page = $this->static_model->getPage($id);
		//print_r($page->title);
		
		$data['page']['detail']= $page;
		
		
		/* META */
		$data['site_title'] = $this->settings_model->siteInfo('web_title');
		$this->template->title($page->meta_title, $data['site_title']);
		$this->template->set_metadata('keywords', $page->meta_keyword);
		$this->template->set_metadata('description', $page->meta_description);
		
		
		$this->template->set_breadcrumb('Home', '/')
		->set_breadcrumb($data['page']['detail']->title, '');
		
		$this->template->set_partial('nav_bar','header/nav_bar');
		$this->template->set_partial('header_search','header/header_search');
		
		$this->template->build('content',$data);
		
		//$this->load->view('content',$data);
		
	}
	
	
	function footer(){
		$data['footer'] = $this->static_model->showPage(2);
		$this->load->view('footer',$data);
	}
	

}